<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>联盟数据管理</title>
<link href="/css/css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<script type="text/javascript" src="http://pic2.58.com/n/tuan/js/jquery-1.4.2.min.js"></script>
<script >
			$(function(){$("#clear").click(function(){ 
					$("#allianceName").val("");
					$("#advertType").val("");
					$("#billingName").val("");
					$("#channel").val("");
					$("#cate1").val("");
					$("#cate2").val("");
                })
             })
			 
			 
			 function updateState(id,upstate){
			 	jQuery.ajax({
        			url:"/ors/alliancemanager/changestate",
            		type:"post",
            		async:true,
            		data:{"upstate":upstate,"id":id},
            		success:function(data){
                		if(data == "error"){
							alert("更新失败！");
						}else if(data == "success"){
							alert("更新成功！");
							document.search.submit();
						}
            		}
            	});
			 }
			 
			 $(function(){$("#addnewbill").click(function(){ 
			 		window.location.href="toaddnewbill";
				 })
			 })
			 
			  $(function(){$("#toupload").click(function(){ 
			 		window.location.href="touploadalliandata";
				 })
			 })
		 
			 $(function(){$("#tosendemail").click(function(){ 
			 		window.location.href="tosendemail";
				 })
			 })
		 
			 
			 $(function(){$("#exescripts").click(function(){ 
			 		window.location.href="exescripts";
				 })
			 })
			 
		 
			$(function(){
        		$("#download").click(function(){
        			$("#down").val(1);
        			document.search.submit();
        		});
			});
		 
			function check(){
        		$("#down").val(0);
    			return true;
			}
</script>
<div class="lr_both">
<div class="right_conts">
  <div class="mg_tt">
    <div class="right_search">
      <div class="rs_title_bg">
        <h2 class="rs_title">联盟数据管理</h2>
      </div>
	  </br>
	  <form id="search" name="search" action="/ors/alliancemanager/manager" method="post" onsubmit="return check();">
		<input type="hidden" id="pageindex" name="pageindex" value="1"/>
		<input type="hidden" id="down" name="down" value="0"/>
		<div class="rs_div" style="height:75px;" > 
			<div pd_text="" style="height:25px;">
				来源&nbsp;&nbsp;&nbsp;&nbsp;
				<select style="width:125px" name="source" id="source">
					<option value="" #if($!{source} == '') selected  #end >全部</option>
					<option value="58" #if($!{source} == '58') selected #end >58</option>
					<option value="jxydt" #if($!{source} == 'jxydt') selected #end >驾校一点通</option>
					<option value="gj" #if($!{source} == 'gj') selected #end >赶集</option>
                </select>
				&nbsp;&nbsp;
				联盟名
				<input type="text" style="width:120px" id="allianceName" name="allianceName" value="$!{allianceName}"/>
				&nbsp;&nbsp;
				广告类型
				<input type="text" style="width:120px" id="advertType" name="advertType" value="$!{advertType}"/>
				&nbsp;&nbsp;
				计费名
				<input type="text" style="width:120px" id="billingName" name="billingName" value="$!{billingName}"/>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        		<input type="submit" name="search" id="search" value="查询"/>
        		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        		<input type="button" id="clear" name="clear"  value="清空条件"/>
			</div>
			
			<div pd_text="" style="height:25px;">
				渠道&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="text" style="width:120px" id="channel" name="channel" value="$!{channel}"/>
				&nbsp;&nbsp;
				一级类 
				<input type="text" style="width:120px" id="cate1" name="cate1" value="$!{cate1}"/>
				&nbsp;&nbsp;
				二级类&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="text" style="width:120px" id="cate2" name="cate2" value="$!{cate2}"/>
            </div>
			
			<div pd_text="" style="height:25px;">
        		<input type="button"  id="toupload" name="toupload" value="上传数据"/>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="button"  id="tosendemail" name="tosendemail" value="发送邮件"/>
        		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        		<input type="button" id="addnewbill" name="addnewbill" value="新增计费名"/>
        		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        		<input type="button" id="exescripts" name="exescripts" value="数据脚本执行"/>
			</div>
        </div>
	
	   </form>
    </div>
     <div class="table_div" style="OVERFLOW-X:yes;OVERFLOW-Y:auto">
      <table class="sj_tl sj_tl_2" width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr style="background:#ffd9b5;">
		   <td align="center" >来源</td>
		   <td align="center" >联盟名</td>
		   <td align="center" >广告类型</td>
		   <td align="center" >计费名</td>
		   <td align="center" >渠道</td>
		   <td align="center" >一级类</td>
		   <td align="center" >二级类</td>
		   <td align="center" >是否与合作方分成</td>
		   <td align="center" >计算公式</td>
		   <td align="center" >广告位置</td>
		   <td align="center" >备注</td>
		   <td align="center" >适用时间</td>
		   <td align="center" >操作</td>
        </tr>
		#if($rsList)
            #foreach($rs in $rsList)
    		<tr onMouseOver="this.className='tdbg10'" onMouseOut="this.className='tdbg11'" class="tdbg11">
			   <td align="center" >$!{rs.source}</td>
    		   <td align="center" >$!{rs.allianceName}</td>
			   <td align="center" >$!{rs.advertType}</td>
    		   <td align="center" >$!{rs.billingName}</td>
			   <td align="center" >$!{rs.channel}</td>
    		   <td align="center" >$!{rs.cate1}</td>
			   <td align="center" >$!{rs.cate2}</td>
    		   <td align="center" >#if($!{rs.isDividWithPartner}==0)否#elseif($!{rs.isDividWithPartner}==1)是#end</td>
			   <td align="center" >$!{rs.formula}</td>
    		   <td align="center" >$!{rs.advertLocation}</td>
			   <td align="center" >$!{rs.mark}</td>
    		   <td align="center" >$!{rs.effectiveTimeStart} / $!{rs.effectiveTimeEnd}</td>
               <td align="center" id="reportstate" name="reportstate" >
				#if($rs.state == 1)
					<a style="color:green" href="/ors/alliancemanager/toedit?id=$!{rs.id}">修改</a> &nbsp &nbsp 
					<a style="color:red" onclick="updateState('$rs.id','0')">失效</a>
				#elseif($rs.state == 0)
					<a style="color:blue" onclick="updateState('$rs.id','1')">恢复</a>
				#end
			   </td>
            </tr>
			#end
		#end
      </table>
	  </br>
	   <div align="right">
		#if($rsList.size() >0)
		<input align="left" type="button" id="download" name="download" value="导出计费名"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		#end
        #parse("/views/default/page.vm")
        #pagebar($pList "/ors/alliancemanager/manager?#page#&$paramurl")
	   </div>
    </div>


  </div>

</div>
</div>
</body>
</html>
